﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Billing.DataObjects;

namespace Billing.Win
{
    public partial class PaymentPointStatusesForm : Billing.WindowsBase.BaseList
    {
        BillingDataContext mBillingDataContext;
        public BillingDataContext BillingDataContext
        {
            get
            {
                if (mBillingDataContext == null)
                    mBillingDataContext = new BillingDataContext();
                return mBillingDataContext;
            }
            set { mBillingDataContext = value; }
        }

        public PaymentPointStatusesForm(bool Register)
            : base(Register)
        {
            InitializeComponent();
        }

        public PaymentPointStatusesForm()
            : this(true)
        {
        }

        protected override void onDataLoad()
        {
            base.onDataLoad();
            bsElement.DataSource = BillingDataContext.PaymentPointStatuses;
        }

        protected override void onElementInitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
        {
            base.onElementInitializeLayout(sender, e);
            if (e.Layout.Bands[0].Columns.Count > 0)
            {
                e.Layout.Bands[0].Columns["CurrentObject"].Hidden = true;
                e.Layout.Bands[0].Columns["Value"].Hidden = true;
                e.Layout.Bands[0].Columns["Key"].Hidden = true;
                e.Layout.Bands[0].Columns["ModifiedDate"].Hidden = true;
                e.Layout.Bands[0].Columns["CreatedDate"].Hidden = true;

                e.Layout.Bands[0].Columns["ID"].Header.Caption = "ინდექსი";
                e.Layout.Bands[0].Columns["Name"].Header.Caption = "სახელი";
                e.Layout.Bands[0].Columns["ID"].Width = 100;
                e.Layout.Bands[0].Columns["Name"].Width = 300;
            }
        }
    }
}
